package com.xl6667.exception;

import com.xl6667.enums.AppHttpCodeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 统一异常类
 * @author 熊磊
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SystemException extends RuntimeException{

    private int code;

    private String msg;


    public SystemException(AppHttpCodeEnum httpCodeEnum) {
        super(httpCodeEnum.getMsg());
        this.code = httpCodeEnum.getCode();
        this.msg = httpCodeEnum.getMsg();
    }
    
}